package com.cw.realtime.common
package bean

case class TradeSkuOrderBean(
  order_detail_id:  String,
  sku_id:           String,
  original_amount:  BigDecimal,
  activity_reduce_amount: BigDecimal,
  coupon_reduce_amount:   BigDecimal,
  order_amount: BigDecimal,
  ts: Long,
  trademark_id:   String = "",
  trademark_name: String = "",
  category1_id:   String = "",
  category1_name: String = "",
  category2_id:   String = "",
  category2_name: String = "",
  category3_id:   String = "",
  category3_name: String = "",
  sku_name: String = "",
  spu_id:   String = "",
  spu_name: String = "",
  stt: String = "",
  edt: String = "",
  cur_date: String = "",
) extends RichBean[TradeSkuOrderBean] {

  override def +(that: TradeSkuOrderBean): TradeSkuOrderBean =
    TradeSkuOrderBean(
      order_detail_id,
      sku_id,
      original_amount + that.original_amount,
      activity_reduce_amount + that.activity_reduce_amount,
      coupon_reduce_amount + that.coupon_reduce_amount,
      order_amount + that.order_amount,
      ts,
      trademark_id, trademark_name, category1_id, category1_name, category2_id, category2_name, category3_id, category3_name, sku_name, spu_id, spu_name, stt, edt, cur_date
    )


  override def transWindowRange(stt: String, edt: String, cur_date: String): TradeSkuOrderBean =
    TradeSkuOrderBean(order_detail_id, sku_id, original_amount, activity_reduce_amount, coupon_reduce_amount, order_amount, ts, trademark_id, trademark_name, category1_id, category1_name, category2_id, category2_name, category3_id, category3_name, sku_name, spu_id, spu_name, stt, edt, cur_date)
}
